package com.alog.common.code;

import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

public class LockThreadTest {
    public static void main(String[] args) {
        Lock lock = new ReentrantLock();
        Condition condition = lock.newCondition();
        for (int i = 0; i < 10; i++) {
            new LockConsumer(lock,condition, "lockconsumer" + i).start();
            new LockProductor(lock,condition, "lockproductor" + i).start();
        }
    }
}
